home *** CD-ROM | disk | FTP | other *** search
- Path: fas-news.harvard.edu!usenet
- From: Kwin Kramer <khkramer@bitwise.net>
- Newsgroups: comp.lang.misc,comp.lang.perl.misc,comp.lang.tcl,comp.lang.c,comp.lang.java
- Subject: Re: Readable Perl (was: Re: Relative Speed of Perl vs. Tcl vs. C)
- Date: Fri, 16 Feb 1996 19:21:03 -0500
- Organization: Harvard University, Cambridge, Massachusetts
- Message-ID: <31251F6F.1F23@bitwise.net>
- References: <4e3a2u$eoa@wcap.centerline.com> <JTV2J.96Feb12142743@mamba.cs.virginia.edu> <ukd97hwzkc.fsf_-_@linda.teleport.com> <4g23sv$dht@alpine.valleynet.com> <4g31jn$q71@csnews.cs.colorado.edu>
- NNTP-Posting-Host: khkramer.student.harvard.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- Tom Christiansen wrote:
-
- > The "when it's not possible case" is demonstrated here:
- >
- > while (<>) { # YANETUT
- > s/^(([A-Z].*?)(:.*?)*?)(:\s*)?\n//
- > and ($3 || $4 ? $card : $sect) = $1;
- > next if /^\s*[=-]/;
- > for (split /\n(?= \S|\+)/) {
- > s/\s+/ /g; s/^ //;
- > $new = s/^\+\s+// ? '+' : '';
- > next if $opt_n and !$new;
- > s/([a-z]\.) ([A-Z])/$1\n$2/g if $opt_s;
- > if ( ($opt_e ? $card : $_) =~ /$query/o ||
- > (!$opt_e && $opt_h && $card =~ /$query/o))
- > >>>> {
- > s/\n/ /g if $opt_s;
- > $matches++;
- > write;
- > ($psect, $pcard) = ($sect, $card);
- > }
- > }
- > }
- >
-
- I love Perl. It's my favorite language, etc. But perhaps the above code
- fragment doesn't really help with the readability argument <grin>.
-
- Kwin
-